{% extends "admin/base_site.html" %}

{% block title %}File details{% endblock %}

{% block content %}
<div id="content-main">
  <h1>File details:</h1>
  <h2>{{ file_entry.complete_filename }}</h2>
  <table>
    <tr>
      <td>Archive</td><td>{{ file_entry.archive }}</td>
    </tr>
    <tr>
      <td>Filepath</td><td>{{ file_entry.filepath }}</td>
    </tr>
    <tr>
      <td>Filesize</td><td>{{ file_entry.human_filesize }} / {{ file_entry.filesize }}</td>
    </tr>
    <tr>
      <td>Created</td><td>{{ file_entry.created_datetime }}</td>
    </tr>
    <tr>
      <td>Modified</td><td>{{ file_entry.modified_datetime }}</td>
    </tr>
    <tr>
      <td>SHA-512 Checksum</td><td>{{ file_entry.checksum }}</td>
    </tr>
    <tr>
      <td>Authentication required</td><td>{{ file_entry.authentication_required }}</td>
    </tr>
    <tr>
      <td>Mature content</td><td>{{ file_entry.mature_content }}</td>
    </tr>
    <tr>
      <td>Personal content</td><td>{{ file_entry.person_content }}</td>
    </tr>
  </table>
  
  <P/>
  <h3>Metadata</h3>
  
  <table>
  {% for k,v in file_entry.get_metadata.items %}
  <tr>
    <td>{{ k }}</td><td>{{ v }}</td>
  </tr>
  {% endfor %}
  </table>
  <h3>Tags</h3>
  <ul>
  {% for tag in file_entry.tags.all %}
  <li>{{ tag }}</li>
  {% endfor %}
  </ul>
  
  <P/>
  <form action="/file/set_value" method="POST">
    <input type="hidden" name="file_entry" value="{{ file_entry.id }}"/>
    <input type="submit" name="Archive this file" value="archive"/>
  </form>

</div>
{% endblock %}
